package plugins

import (
	"context"
	"data-transfer/domain"
	"github.com/go-mysql-org/go-mysql/canal"
)

type DataMonitor interface {
	// MonitorDataChange 监控数据变化
	MonitorDataChange(ctx context.Context, handler canal.EventHandler, startFlag string) error

	// GetTqSkBasicInfoByCompanyCode 根据compCode 获取股票基本信息，只查询上市状态的有效数据
	GetTqSkBasicInfoByCompanyCode(compCode string) ([]*domain.TQ_SK_BASICINFO, error)

	//GetTqSkBasicInfoBySeCode seCode 获取股票基本信息
	GetTqSkBasicInfoBySeCode(seCode string) (*domain.TQ_SK_BASICINFO, error)

	// GetSymbolByCompCode 根据compCode取得证券类别,存在相同compCode对应多个symbol的情况，例如 双杰电气（80129235）对应symbol为：430049和300444
	GetSymbolByCompCode(compCode string) ([]*domain.TQ_SK_BASICINFO, error)

	// GetFileLinkByAnnouncemtId 根据announcementId 获取PDF文件路径
	GetFileLinkByAnnouncemtId(announcemtId string) (string, error)

	// GetCompCodeBySymbol 根据compCode取得symbol
	GetCompCodeBySymbol(symbol string) (string, error)

	//GetSymbolByTrCode 根据trCode获取T_QNEWS_ANIMPM表中的symbol
	GetSymbolByTrCode(trCode string) (string, error)

	//GetSymbolBySourceKey 根据sourceKey获取T_QNEWS_ANIMPM表中的symbol
	GetSymbolBySourceKey(sourceKey string) (string, error)

	// GetTqSkBasicInfoBySymbol 根据symbol 获取股票基本信息,只查询上市状态的有效数据
	GetTqSkBasicInfoBySymbol(symbol string) (*domain.TQ_SK_BASICINFO, error)

	//GetStdRatingCountsBySymbolAndRatingValid 根据symbol和评级有效期获取评级机构统计对象
	GetStdRatingCountsBySymbolAndRatingValid(symbol string, ratingValid string) (*domain.RATING_COUNT, error)

	// GetPersonRecordByPersonalCode 根据 personalCode 获取个人档案信息
	GetPersonRecordByPersonalCode(personalCode string) (*domain.TQ_COMP_PERSONRECORD, error)

	//GetCompManagerByPersonalCode 根据  personalCode 获取公司高管入职和辞职等信息
	GetCompManagerByPersonalCode(personalCode string) (*domain.TQ_COMP_MANAGER, error)

	//GetTqSkBusiInfoByCompCodeAndReportYear 根据compCode和reportYear 获取公司经营状况
	GetTqSkBusiInfoByCompCodeAndReportYear(compCode string, reportYear string) ([]*domain.TQ_SK_BUSIINFO, error)

	//GetTqFinPrgIncStatementNewByCompCodeAndReportYear 查询指定会计年度、报表类型为1合并期末的企业利润信息
	GetTqFinPrgIncStatementNewByCompCodeAndReportYear(compCode string, reportYear string) ([]*domain.TQ_FIN_PRGINCSTATEMENTNEW, error)

	//GetCompInfoByCompCode 根据compCode获取机构资料信息
	GetCompInfoByCompCode(compCode string) ([]*domain.TQ_COMP_INFO, error)

	//GetSkDailyPrices4DataChange 根据Secode和tradeDate获取股票历史日交易信息
	GetSkDailyPrices4DataChange(seCode string, tradeDate string) ([]*domain.TQ_QT_SKDAILYPRICE, error)

	//GetTqSkShareHolderNumByCompCodeAndEndDate 根据compCode和截止日期获取股东户数统计数据
	GetTqSkShareHolderNumByCompCodeAndEndDate(compCode string, endDate string) ([]*domain.TQ_SK_SHAREHOLDERNUM, error)

	//GetShareStruChgByCompCodeAndPublishDate 根据compCode和信息发布日期取得股本结构变化信息
	GetShareStruChgByCompCodeAndPublishDate(compCode string, publishDate string) (*domain.TQ_SK_SHARESTRUCHG, error)

	// GetTqSkShareHolderByCompCodeAndPublishDate 根据compCode和信息发布日期，获取股东名单列表
	GetTqSkShareHolderByCompCodeAndPublishDate(compCode string, publishDate string) ([]*domain.TQ_SK_SHAREHOLDER, error)

	//最新指标使用
	GetPrgFinMainIndexByCompCodeAndEndDate(compCode string, endDate string) ([]*domain.TQ_FIN_PRGFINMAININDEX, error)
	//GetPrgIncStatementNewByCompCodeAndEndDate 取得财务数据： 根据 compCode 取得  一般企业利润表(新准则产品表)
	GetPrgIncStatementNewByCompCodeAndEndDate(compCode string, endDate string) ([]*domain.TQ_FIN_PRGINCSTATEMENTNEW, error)
	//GetPrgIndicDataByCompCodeAndEndDate 财务数据-主要指标：根据 compCode 取得 衍生财务指标(产品表)信息
	GetPrgIndicDataByCompCodeAndEndDate(compCode string, endDate string) ([]*domain.TQ_FIN_PRGINDICDATA, error)
	//GetPrgIndicDataSubByCompCodeAndEndDate 财务数据-主要指标：根据 compCode 取得 衍生财务指标副表(产品表) 数据
	GetPrgIndicDataSubByCompCodeAndEndDate(compCode string, endDate string) ([]*domain.TQ_FIN_PRGINDICDATASUB, error)
	GetTqSkFundamentalsBySymbolAndEndDate(symbol string, endDate string) ([]*domain.TQ_SK_FUNDAMENTALS, error)

	//GetTqFinPrgbincstatementnewByCompCodeAndDate 根据业务主键获取银行利润表信息
	GetTqFinPrgbincstatementnewByCompCodeAndDate(compCode string, endDate string, reportYear string, reportDateType string) (*domain.TQ_FIN_PRGBINCSTATEMENTNEW, error)
	//GetPrgIncStatementNewByBizKey 根据业务主键查询一般企业利润信息
	GetPrgIncStatementNewByBizKey(compCode string, endDate string, reportYear string, reportDateType string) (*domain.TQ_FIN_PRGINCSTATEMENTNEW, error)
	//主要指标使用
	GetTqFinPrgFinMainIndexByBizKey(compCode string, endDate string, reportDateType string) (*domain.TQ_FIN_PRGFINMAININDEX, error)
	GetTqFinPrgIndicDataByBizKey(compCode string, endDate string, reportDateType string) (*domain.TQ_FIN_PRGINDICDATA, error)
	GetTqFinPrgIndicDataSubByBizKey(compCode string, endDate string, reportDateType string) (*domain.TQ_FIN_PRGINDICDATASUB, error)

	//财务单季度-主要指标使用
	//GetTqFinPrgPasqSubjects  获取单季衍生利润科目(产品表）信息
	GetTqFinPrgPasqSubjects(compCode string, endDate string, reportType string) (*domain.TQ_FIN_PRGPASQSUBJECTS, error)
	//GetTqFinProQinDic 获取单季衍生指标（产品表）信息
	GetTqFinProQinDic(compCode string, endDate string, reportType string) (*domain.TQ_FIN_PROQINDIC, error)

	//SyncBinlogPosition 定时同步mysql binlog position信息
	SyncBinlogPosition()
}
